package br.com.firula.to;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name="conteudista")
@Inheritance(strategy=InheritanceType.JOINED)
public class ConteudistaTO extends UsuarioBaseTO{

	private static final long serialVersionUID = -5103953428697413558L;

	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinTable(name="rel_conteudista_time",
        joinColumns=@JoinColumn(name="idConteudista", nullable = false, referencedColumnName="id"),
        inverseJoinColumns=@JoinColumn(name="idTime", nullable = false, referencedColumnName="id"))
	private List<TimeTO> times;

	public List<TimeTO> getTimes() {
		return times;
	}

	public void setTimes(List<TimeTO> times) {
		this.times = times;
	}

}
